package com.huawei.appmarket.support.audio;

import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import o.Logger;
import o.eoz;
import o.epe;
import o.epn;

public class AudioPlayService extends Service {
    private eoz ˊ;
    private final IBinder ˏ = new a(this);

    public class a extends Binder {
        final /* synthetic */ AudioPlayService ˊ;

        public a(AudioPlayService audioPlayService) {
            this.ˊ = audioPlayService;
        }

        public eoz ˏ() {
            return this.ˊ.ˊ;
        }
    }

    public IBinder onBind(Intent intent) {
        if (Logger.ˎ()) {
            Logger.ˏ("AudioPlayService", "onBind");
        }
        return this.ˏ;
    }

    public void onCreate() {
        if (Logger.ˎ()) {
            Logger.ˏ("AudioPlayService", "onCreate");
        }
        super.onCreate();
        this.ˊ = new eoz();
    }

    public int onStartCommand(Intent intent, int i, int i2) {
        if (Logger.ˎ()) {
            Logger.ˏ("AudioPlayService", "onStartCommand");
        }
        Notification ˋ = epn.ˎ().ˋ(epe.ˏ().ॱ());
        if (ˋ != null) {
            startForeground(1, ˋ);
        } else {
            stopSelf();
        }
        return super.onStartCommand(intent, i, i2);
    }

    public void onDestroy() {
        if (Logger.ˎ()) {
            Logger.ˏ("AudioPlayService", "onDestroy");
        }
        stopForeground(true);
        if (this.ˊ != null) {
            this.ˊ.ˏ();
            this.ˊ = null;
        }
        super.onDestroy();
    }
}
